I. Relationship between the return value of OS. System (CMD) in Python and the return value of Linux commands (For details, refer to the additional content in this article)
Everyone is used to using the OS. systemv () function to execute Linux
It is mainly included in the C source file OS _core.c.1. uC/OS-II Task Scheduling (1) uC/OS-II Scheduling Algorithm
UC/OS-II uses the priority-based scheduling algorithm, always select the current ready state of the highest priority task scheduling.
Recently encountered Os.system () execution System command, the Internet collected a bit of information, organized as follows, in case of a rainy days, but also hope to help some people.The relationship between the return value of Os.system (cmd) in
Add: if a third partyProgramThe return value is a Boolean value. OS. system converts true to 1, false to 0, and returns the result.
The forwarding is as follows:
I remember a friend on the python.cn email list asked me about the abnormal return
"abstract" in order to reduce the development difficulty of DSP system software, to ensure the real-time nature of the system, shorten the development cycle, the embedded real-time operating system Μc/os-ⅱ porting to the DSP chip is a common method
In the C language we started with, the main function in the int main () function of the last always add a return 0; As the returned value, we did not know what the meaning of this return value, we often use the normal function of the return value,
The return value of the Linux commandQuite useful for some monitoring scripts and probing commands;Under Linux, whether you start a desktop program or run a command under the console, all programs end with a numeric value called the return value, or
Interruption system design of μC/OS-Ⅱ on the X Platform
[Date: May 10,
Source: single-chip microcomputer and Embedded System Application Author: Bai Fenge, Taiyuan University of Technology Chen Yanbin
[Font:Large Medium Small]
All programs end with a numeric value, return value, or error numberSpecial variable environment $? Save the previous program's return valueecho $?0 indicates that the program executes successfully, not 0, which indicates an error occurred during
Python calls shell scripts in two ways: OS. system (CMD) or OS. popen (CMD), the former returns the exit code of the script, and the latter returns the output content during script execution. The actual usage depends on your needs.
Assume that
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.